<template>
    <div class="toast-list" v-show="toast_data.show">
        <div class="toast-item">
            <div class="icon" :style="`--icon: url(${ toast_data.icon })`"></div>
            <div class="message">{{ toast_data.message }}</div>
        </div>
    </div>
</template>

<script setup>
import { toast_data } from '@/service/status';
</script>

<style scoped lang="less">
// 定义旋转动画关键帧
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.toast-list {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;

    .toast-item {
        width: 40vw;
        padding: 5vw;
        border-radius: 2vw;
        background-color: #fff;
        box-shadow: 0 0 10vw rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2vw;
        
        .icon {
            --size: 8vw;
            --w: var(--size);
            --h: var(--size);
        }

        .message {
            font-size: 3.5vw;
            text-align: center;
            color: var(--text-color);
        }
    }
}
</style>